#include "zgsprite.h"
#include <raylib.h>

int main() {
    // 初始化窗口
    Window::Init(800, 600, "测试画笔功能");

    // 创建画笔
    Pen pen;
    pen.SetColor(BLUE);
    pen.SetThickness(3.0f);

    // 主循环
    while (!Window::ShouldClose()) {
        Window::BeginDraw();

        // 测试移动和旋转
        pen.SetPosition(100, 100);
        pen.PenDown();
        pen.Forward(100);
        pen.TurnRight(90);
        pen.Forward(100);

        // 测试绘制图形
        pen.SetColor(RED);
        pen.DrawRectangle(300, 100, 100, 50);
        pen.DrawFilledCircle(400, 300, 50);

        // 测试文本渲染
        pen.SetColor(BLACK);
        pen.DrawText("Hello, 你好!", { 200, 200 }, 30, BLACK,"fonts/LXGWWenKaiMonoScreen.ttf");
        pen.DrawTextWithBackground("Pen 哈哈哈", { 100, 150 }, 30, YELLOW);
        unsigned int fileSize;
        unsigned char* fontFileData = LoadFileData("fonts/LXGWWenKaiMonoScreen.ttf", &fileSize);
        int codepointsCount;
        int* codepoints = LoadCodepoints("文字效果测试", &codepointsCount);
        Font font = LoadFontFromMemory(".ttf", fontFileData, 32, 32, codepoints, codepointsCount);
        DrawTextEx(font, "文字效果测试", (Vector2) { 100, 100 }, 40, 30, GREEN);
        int codepointsCount2;
        int* codepoints2 = LoadCodepoints("文字效果测试2", &codepointsCount2);
        Font font2 = LoadFontFromMemory(".ttf", fontFileData, 32, 32, codepoints2, codepointsCount2);
        DrawTextEx(font2, "文字效果测试2", (Vector2) { 100, 150 }, 40, 30, GREEN);
        delete fontFileData;
        Window::EndDraw();
    }

    // 关闭窗口
    Window::Close();
    return 0;
}